package com.jyw.business.obstacles.domain.vo.wechat;

import com.jyw.business.obstacles.domain.ObsOrderEvaluate;
import com.jyw.business.obstacles.domain.vo.web.OrderEvaluateVO;
import com.jyw.common.annotation.Conversion;
import com.jyw.common.enums.ConversionType;
import com.jyw.common.utils.bean.BeanUtils;
import com.jyw.system.domain.vo.SimpleFileVo;
import com.jyw.system.utils.FileUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.FieldNameConstants;

import java.util.Date;
import java.util.List;

/**
 * @author Created by ZhangCheng on 2023/09/07
 */
@Data
@ApiModel("微信工单评价信息")
@NoArgsConstructor
@FieldNameConstants
public class WxWorkOrderEvaluateVO {

    /**
     * 工单号
     */
    @ApiModelProperty("工单号")
    private String orderNum;

    /**
     * 服务态度
     */
    @ApiModelProperty("服务态度")
    private Double serviceAttitude;

    /**
     * 服务质量
     */
    @ApiModelProperty("服务质量")
    private Double serviceQuality;

    /**
     * 响应时效
     */
    @ApiModelProperty("响应时效")
    private Double responsePrescription;

    /**
     * 评价结果
     */
    @ApiModelProperty("评价结果")
    private Integer evaluateResult;

    /**
     * 意见与建议
     */
    @ApiModelProperty("意见与建议")
    private String commentSuggestion;

    /**
     * 签名
     */
    @ApiModelProperty("签名")
    private String autograph;

    /**
     * 附件
     */
    @ApiModelProperty("附件")
    private List<SimpleFileVo> enclosure;

    /**
     * 创建者
     */
    @ApiModelProperty("创建者")
    @Conversion(value = ConversionType.USER,name = OrderEvaluateVO.Fields.createUserName)
    private Long createUser;

    @ApiModelProperty("创建者名称")
    private String createUserName;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private Date createTime;

    public WxWorkOrderEvaluateVO(ObsOrderEvaluate evaluate) {
        BeanUtils.copyProperties(evaluate,this);
        setEnclosure(FileUtils.IdToFile(evaluate.getEnclosure()));
    }
}
